#pragma once
#include <iostream>

enum
{
    INFO,
    DEBUG,
    WARNNING,
    ERROR,
    FATAL
};

inline std::ostream &Log(const std::string &level, const std::string &file_name, int line)
{
    // 日志等级
    std::string message = "[";
    message += level;
    message += "]";

    // 文件和行数
    message += "[";
    message += file_name;
    message += ":";
    message += std::to_string(line);
    message += "]";

    // 添加时间戳
    message += "[";
    message += TimeUtil::GetTimeStamp();
    message += "]";
    std::cout << message;

    return std::cout;
}

// 开放式日志
#define LOG(level) Log(#level, __FILE__, __LINE__)
